package com.yonyou.pmclouds.inspectitem.process;

import com.yonyou.pmclouds.basecom.bp.processor.SingleProcessor;
import com.yonyou.pmclouds.basecom.exception.BusinessException;
import com.yonyou.pmclouds.inspectitem.entity.InspectItemVO;
import com.yonyou.pmclouds.measuredata.service.rmiitf.MeasureDataService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * 检查项修改完成后，修改测量数据
 * @author wuhaok
 *
 */
@Component
public class InspectItemUpdateAfterProcess implements SingleProcessor<InspectItemVO> {
    @Autowired
    private MeasureDataService measureService;

    @Override
    public void process(InspectItemVO vo, InspectItemVO orig) throws BusinessException {
        if(vo == null){
            throw new BusinessException("单据不能为空！");
        }
        // 修改测量数据
        if(vo.isModified()) {
            measureService.update(vo.getDatas(), vo.getPk_inspectitem());
        }
    }
}
